/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * MDI.java
 *
 * Created on 20/10/2011, 13:49:25
 */

package br.com.fatecpg.tp1.mdi;

import br.com.fatecpg.tp1.formularios.Aceleracao;
import br.com.fatecpg.tp1.formularios.CalculadoraMassa;
import br.com.fatecpg.tp1.formularios.ConversorVelocidade;
import br.com.fatecpg.tp1.formularios.Potencia;
import br.com.fatecpg.tp1.formularios.Pressão;
import br.com.fatecpg.tp1.formularios.Resistenciaeletrica;


import br.com.fatecpg.tp1.formularios.Tempo;
import br.com.fatecpg.tp1.formularios.Volume;
import br.com.fatecpg.tp1.formularios.conversorArmazenamento;
import br.com.fatecpg.tp1.formularios.conversorComprimento;
import br.com.fatecpg.tp1.formularios.conversorMoeda;

import br.com.fatecpg.tp1.formularios.eletricidade;
import br.com.fatecpg.tp1.formularios.larguraDeBanda;
import br.com.fatecpg.tp1.formularios.temperatura;
import java.awt.Image;
import java.awt.Toolkit;

 import javax.swing.ImageIcon;
import javax.swing.JFrame;

/**
 *
 * @author Bia
 */
public class MDI extends javax.swing.JFrame {

    /** Creates new form MDI */
    public MDI() {
        initComponents();
        //deixar tudo maximizado
         setExtendedState(JFrame.MAXIMIZED_BOTH);
         // teste de img icon
      //  ImageIcon imagemTituloJanela = new ImageIcon("fire.png");
       // setIconImage(imagemTituloJanela.getImage());

       // Image Icone = Toolkit.getDefaultToolkit().getImage("/imagens/fire.gif");
       // setIconImage(Icone);

         this.setIconImage(new ImageIcon("/imagens/fire.gif").getImage());

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        DesktopPane = new javax.swing.JDesktopPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        MenuBar = new javax.swing.JMenu();
        conversorAceleracaoMenuItem = new javax.swing.JMenuItem();
        conversorComprimentoMenuItem = new javax.swing.JMenuItem();
        conversorCorrenteEletricaMenuItem = new javax.swing.JMenuItem();
        conversorMassaMenuItem = new javax.swing.JMenuItem();
        conversorMoedaMenuItem = new javax.swing.JMenuItem();
        conversorPotenciaMenuItem = new javax.swing.JMenuItem();
        conversorPressaoMenuItem = new javax.swing.JMenuItem();
        conversorResistenciaEletricaMenuItem = new javax.swing.JMenuItem();
        conversorTemperaturaMenuItem = new javax.swing.JMenuItem();
        conversorTempoMenuItem = new javax.swing.JMenuItem();
        conversorVelocidadeMenuItem = new javax.swing.JMenuItem();
        conversorVolumeMenuItem = new javax.swing.JMenuItem();
        ComputacaoMenu = new javax.swing.JMenu();
        conversorArmazenarDadosMenuItem = new javax.swing.JMenuItem();
        conversorLarguraBandaMenuItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Conversor de Medidas");
        setBackground(new java.awt.Color(63, 98, 104));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowActivated(java.awt.event.WindowEvent evt) {
                formWindowActivated(evt);
            }
        });

        DesktopPane.setBackground(new java.awt.Color(63, 98, 104));

        jMenuBar1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        MenuBar.setText("Conversor");

        conversorAceleracaoMenuItem.setText("Aceleração");
        conversorAceleracaoMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorAceleracaoMenuItemActionPerformed(evt);
            }
        });
        MenuBar.add(conversorAceleracaoMenuItem);

        conversorComprimentoMenuItem.setText("Comprimento");
        conversorComprimentoMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorComprimentoMenuItemActionPerformed(evt);
            }
        });
        MenuBar.add(conversorComprimentoMenuItem);

        conversorCorrenteEletricaMenuItem.setText("Corrente Elétrica");
        conversorCorrenteEletricaMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorCorrenteEletricaMenuItemActionPerformed(evt);
            }
        });
        MenuBar.add(conversorCorrenteEletricaMenuItem);

        conversorMassaMenuItem.setText("Massa");
        conversorMassaMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorMassaMenuItemActionPerformed(evt);
            }
        });
        MenuBar.add(conversorMassaMenuItem);

        conversorMoedaMenuItem.setText("Moeda");
        conversorMoedaMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorMoedaMenuItemActionPerformed(evt);
            }
        });
        MenuBar.add(conversorMoedaMenuItem);

        conversorPotenciaMenuItem.setText("Potência");
        conversorPotenciaMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorPotenciaMenuItemActionPerformed(evt);
            }
        });
        MenuBar.add(conversorPotenciaMenuItem);

        conversorPressaoMenuItem.setText("Pressão");
        conversorPressaoMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorPressaoMenuItemActionPerformed(evt);
            }
        });
        MenuBar.add(conversorPressaoMenuItem);

        conversorResistenciaEletricaMenuItem.setText("Resistência Elétrica");
        conversorResistenciaEletricaMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorResistenciaEletricaMenuItemActionPerformed(evt);
            }
        });
        MenuBar.add(conversorResistenciaEletricaMenuItem);

        conversorTemperaturaMenuItem.setText("Temperatura");
        conversorTemperaturaMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorTemperaturaMenuItemActionPerformed(evt);
            }
        });
        MenuBar.add(conversorTemperaturaMenuItem);

        conversorTempoMenuItem.setText("Tempo");
        conversorTempoMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorTempoMenuItemActionPerformed(evt);
            }
        });
        MenuBar.add(conversorTempoMenuItem);

        conversorVelocidadeMenuItem.setText("Velocidade");
        conversorVelocidadeMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorVelocidadeMenuItemActionPerformed(evt);
            }
        });
        MenuBar.add(conversorVelocidadeMenuItem);

        conversorVolumeMenuItem.setText("Volume");
        conversorVolumeMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorVolumeMenuItemActionPerformed(evt);
            }
        });
        MenuBar.add(conversorVolumeMenuItem);

        ComputacaoMenu.setText("Computação");
        ComputacaoMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ComputacaoMenuActionPerformed(evt);
            }
        });

        conversorArmazenarDadosMenuItem.setText("Armazenamento de Dados");
        conversorArmazenarDadosMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorArmazenarDadosMenuItemActionPerformed(evt);
            }
        });
        ComputacaoMenu.add(conversorArmazenarDadosMenuItem);

        conversorLarguraBandaMenuItem.setText("Largura da Banda");
        conversorLarguraBandaMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                conversorLarguraBandaMenuItemActionPerformed(evt);
            }
        });
        ComputacaoMenu.add(conversorLarguraBandaMenuItem);

        MenuBar.add(ComputacaoMenu);

        jMenuBar1.add(MenuBar);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(DesktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 634, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(DesktopPane, javax.swing.GroupLayout.DEFAULT_SIZE, 515, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void conversorVolumeMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorVolumeMenuItemActionPerformed
        Volume f = new Volume();
        DesktopPane.add(f);
        f.setVisible(true);
    }//GEN-LAST:event_conversorVolumeMenuItemActionPerformed

    private void conversorComprimentoMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorComprimentoMenuItemActionPerformed
        conversorComprimento f = new conversorComprimento();
        DesktopPane.add(f);
        f.setVisible(true);
    }//GEN-LAST:event_conversorComprimentoMenuItemActionPerformed

    private void conversorMassaMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorMassaMenuItemActionPerformed
       CalculadoraMassa f = new CalculadoraMassa();
       DesktopPane.add(f);
       f.setVisible(true);
    }//GEN-LAST:event_conversorMassaMenuItemActionPerformed

    private void conversorPressaoMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorPressaoMenuItemActionPerformed
       Pressão f = new Pressão();
       DesktopPane.add(f);
       f.setVisible(true);
    }//GEN-LAST:event_conversorPressaoMenuItemActionPerformed

    private void conversorTempoMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorTempoMenuItemActionPerformed
        Tempo f = new Tempo();
        DesktopPane.add(f);
        f.setVisible(true);
    }//GEN-LAST:event_conversorTempoMenuItemActionPerformed

    private void conversorPotenciaMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorPotenciaMenuItemActionPerformed
       Potencia f = new Potencia();
        DesktopPane.add(f);
        f.setVisible(true);
    }//GEN-LAST:event_conversorPotenciaMenuItemActionPerformed

    private void conversorResistenciaEletricaMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorResistenciaEletricaMenuItemActionPerformed
        Resistenciaeletrica f = new Resistenciaeletrica();
        DesktopPane.add(f);
        f.setVisible(true);
    }//GEN-LAST:event_conversorResistenciaEletricaMenuItemActionPerformed

    private void conversorCorrenteEletricaMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorCorrenteEletricaMenuItemActionPerformed
        eletricidade f = new eletricidade();
        DesktopPane.add(f);
        f.setVisible(true);
    }//GEN-LAST:event_conversorCorrenteEletricaMenuItemActionPerformed

    private void formWindowActivated(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowActivated
//        JFrame f = new JFrame();
//        f.setExtendedState(MDI.MAXIMIZED_BOTH);
        // adicionado codigo correto abaixo do initComponents();
    }//GEN-LAST:event_formWindowActivated

    private void conversorVelocidadeMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorVelocidadeMenuItemActionPerformed
       ConversorVelocidade f = new ConversorVelocidade();
       DesktopPane.add(f);
       f.setVisible(true);
    }//GEN-LAST:event_conversorVelocidadeMenuItemActionPerformed

    private void conversorTemperaturaMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorTemperaturaMenuItemActionPerformed
       temperatura f = new temperatura();
       DesktopPane.add(f);
       f.setVisible(true);
    }//GEN-LAST:event_conversorTemperaturaMenuItemActionPerformed

    private void conversorMoedaMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorMoedaMenuItemActionPerformed
        conversorMoeda f = new conversorMoeda();
        DesktopPane.add(f);
        f.setVisible(true);
    }//GEN-LAST:event_conversorMoedaMenuItemActionPerformed

    private void ComputacaoMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ComputacaoMenuActionPerformed
       //errado
    }//GEN-LAST:event_ComputacaoMenuActionPerformed

    private void conversorLarguraBandaMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorLarguraBandaMenuItemActionPerformed
        // TODO add your handling code here:
       larguraDeBanda f = new larguraDeBanda();
       DesktopPane.add(f);
       f.setVisible(true);
    }//GEN-LAST:event_conversorLarguraBandaMenuItemActionPerformed

    private void conversorAceleracaoMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorAceleracaoMenuItemActionPerformed
       Aceleracao f = new Aceleracao();
       DesktopPane.add(f);
        f.setVisible(true);
    }//GEN-LAST:event_conversorAceleracaoMenuItemActionPerformed

    private void conversorArmazenarDadosMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_conversorArmazenarDadosMenuItemActionPerformed
        conversorArmazenamento f = new conversorArmazenamento();
        DesktopPane.add(f);
        f.setVisible(true);
    }//GEN-LAST:event_conversorArmazenarDadosMenuItemActionPerformed

    /**
    * @param args the command line arguments
    */

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new MDI().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenu ComputacaoMenu;
    private javax.swing.JDesktopPane DesktopPane;
    private javax.swing.JMenu MenuBar;
    private javax.swing.JMenuItem conversorAceleracaoMenuItem;
    private javax.swing.JMenuItem conversorArmazenarDadosMenuItem;
    private javax.swing.JMenuItem conversorComprimentoMenuItem;
    private javax.swing.JMenuItem conversorCorrenteEletricaMenuItem;
    private javax.swing.JMenuItem conversorLarguraBandaMenuItem;
    private javax.swing.JMenuItem conversorMassaMenuItem;
    private javax.swing.JMenuItem conversorMoedaMenuItem;
    private javax.swing.JMenuItem conversorPotenciaMenuItem;
    private javax.swing.JMenuItem conversorPressaoMenuItem;
    private javax.swing.JMenuItem conversorResistenciaEletricaMenuItem;
    private javax.swing.JMenuItem conversorTemperaturaMenuItem;
    private javax.swing.JMenuItem conversorTempoMenuItem;
    private javax.swing.JMenuItem conversorVelocidadeMenuItem;
    private javax.swing.JMenuItem conversorVolumeMenuItem;
    private javax.swing.JMenuBar jMenuBar1;
    // End of variables declaration//GEN-END:variables

    
    

}
